require "wondercap/lib/multi_configuration/multi_configuration"

module Wondercap
  
  module Define
    def define_cfg(name, *args, &block)
      #multi_configuration is provided by the importer-class
      config = multi_configuration.get_configuration(name)

      #TODO: cleaner implementation (http://blogger.jayfields.com/2006/09/ruby-instanceexec-aka-instanceeval.html)
      class << config; self; end.send :define_method, :_define_single, &block
      config.send :_define_single, *args
      class << config; self; end.send :remove_method, :_define_single
    end
    
  end
end